AbstractControlPlugin{

	var vals, currentStep = 0;

	*new{
		^super.new.init
	}
	
	init{
		vals = OrderedEnvir.new;
		this.populateVals;
		this.onInit;
	}
	
	onInit{
	
	}
	
	populateVals{}

	getName{
		^"abstract plugin"
	}
	
	launchGui{
		this.getGuiClass.new(this)	
	}
	
	getGuiClass{
		^PluginGui
	}
	
	getVals{
		^vals;
	}
	
	setValue{|name, val|
		// if it's a number, turn it in to an Integer
		
		if(
			(StringUtils.isNumber(val)), // it's text
			{val = val.asFloat}
		);
		vals.put(name, val);
		this.onSetValue;	
	}
	
	onSetValue{
	
	}
	
	process{|value|
		^value;
	}
	
	reset{
		currentStep = 0;
		this.onReset;
	}
	
	onReset{
		// override in subclasses
	}
	
	accept{|xb|
		xb.forControlPlugin(this);
	}
	
	
	getSpec{|key|
		var spec;
		spec = this.getSpecs.at(key);
		if(spec == nil){
			spec = ControlSpec.new
		}
		^spec;	
	}
	
	getSpecs{
		^Dictionary.new;
	}
	
}
